#!/bin/sh
#
# Copyright (C) 2007 Dave Moore
# Copyright (C) 2007 Steve Mulligan
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

dir=`echo "$0" | sed 's,[^/]*$,,'`
test "x${dir}" = "x" && dir='.'

if test "x`cd "${dir}" 2>/dev/null && pwd`" != "x`pwd`"
then
    echo "This script must be executed directly from the source directory."
    exit 1
fi

rm -f config.cache acconfig.h

echo "- aclocal."                      && \
aclocal -I m4                          && \
echo "- libtoolize."                   && \
libtoolize --copy --force              && \
echo "- autoheader"                    && \
autoheader                             && \
echo "- autoconf."                     && \
autoconf                               && \
echo "- automake."                     && \
automake --add-missing --gnu --copy    && \
exit 0

exit 1
